package me.xplabs.ui.baseui 
{
	import flash.display.BitmapData;
	import flash.events.MouseEvent;
	import flash.geom.Rectangle;
	import me.xplabs.ui.BaseSprite;
	import me.xplabs.ui.common.ScaleBitmap;
	
	/**
	 * ...
	 * @author xiaohan
	 */
	public class Panel extends BaseSprite 
	{
		private var _bitmap					:*;
		public function Panel() 
		{
			
		}
		public function show(data:BitmapData, px:int = 0, py:int = 0, pw:int = 0, ph:int = 0):void
		{
			if (!data) return;
			_bitmap = new ScaleBitmap(data);
			_bitmap.scale9Grid = new Rectangle(px, py, pw, ph);
			addChild(_bitmap);
		}
		
		public function setWH(pw:int,ph:int):void
		{
			if (!_bitmap) return;
			if (pw > 0) _bitmap.width = pw;
			if (ph > 0) _bitmap.height = ph;
		}
	}

}